package pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 分页对象
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Page<T> {

    private List<T> list;           //分页数据
    private int page;               //第几页
    private int size;               //每页多少条
    private int count;              //总条数
    private int pageCount;          //总页数

    public Page(int page, int size, List<T> list, int count) {
        this.list = list;
        this.page = page;
        this.size = size;
        this.count = count;
        this.pageCount = (int) Math.ceil(count*1.0/size);
    }
}
